package com.htgd.gardenexpo.service.impl;

import com.htgd.gardenexpo.entity.GeConTouristLineFeedback;
import com.htgd.gardenexpo.dao.GeConTouristLineFeedbackDao;
import com.htgd.gardenexpo.service.GeConTouristLineFeedbackService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (GeConTouristLineFeedback)表服务实现类
 *
 * @author makejava
 * @since 2021-06-09 11:40:15
 */
@Service("geConTouristLineFeedbackService")
public class GeConTouristLineFeedbackServiceImpl implements GeConTouristLineFeedbackService {
    @Resource
    private GeConTouristLineFeedbackDao geConTouristLineFeedbackDao;

    /**
     * 通过ID查询单条数据
     *
     * @param 主键
     * @return 实例对象
     */
    @Override
    public GeConTouristLineFeedback queryById() {
        return this.geConTouristLineFeedbackDao.queryById();
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<GeConTouristLineFeedback> queryAllByLimit(int offset, int limit) {
        return this.geConTouristLineFeedbackDao.queryAllByLimit(offset, limit);
    }

    @Override
    public List<GeConTouristLineFeedback> getinfoByLineId(int id) {
        return this.geConTouristLineFeedbackDao.getinfoByLineId(id);
    }

    /**
     * 新增数据
     *
     * @param geConTouristLineFeedback 实例对象
     * @return 实例对象
     */
    @Override
    public GeConTouristLineFeedback insert(GeConTouristLineFeedback geConTouristLineFeedback) {
        this.geConTouristLineFeedbackDao.insert(geConTouristLineFeedback);
        return geConTouristLineFeedback;
    }

    /**
     * 修改数据
     *
     * @param geConTouristLineFeedback 实例对象
     * @return 实例对象
     */
    @Override
    public GeConTouristLineFeedback update(GeConTouristLineFeedback geConTouristLineFeedback) {
        this.geConTouristLineFeedbackDao.update(geConTouristLineFeedback);
        return this.queryById();
    }

    /**
     * 通过主键删除数据
     *
     * @param 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById() {
        return this.geConTouristLineFeedbackDao.deleteById() > 0;
    }
    @Override
    public boolean deleteByLineId(int id) {
        return this.geConTouristLineFeedbackDao.deleteByLineId(id) > 0;
    }
}
